#include "main.h"

/*
 * EN
 * This file contains all constants.
 *
 * CZ
 * Tento soubor obsahuje konstanty.
 */

// casovy interval 1min = 60s
double timeInterval = 60;

// extremni pripady teplot
double maxTemperatureInside         = 30;
double minTemperatureInside         =  6;
double minTemperatureOutside        =-34;
double minTemperatureGround         =-10;

// aktualni teploty venku
double currentTemperatureOutsideN   = 10;
double currentTemperatureOutsideS   = 10;
double currentTemperatureOutsideW   = 10;
double currentTemperatureOutsideE   = 10;
double currentTemperatureSoil       = 10;
double currentTemperatureSky        = 10;


// tloustka materialy pro typy sten v m
double thicknessOutsidePorotherm    = 0.2;
double thicknessOutsidePolystyren   = 0.05;
double thicknessInsidePorotherm     = 0.2;
double thicknessGroundPorotherm     = 0.2;
double thicknessGroundPolystyren    = 0.2;
double thicknessRoofPorotherm       = 0.2;
double thicknessRoofPolystyren      = 0.2;

// soucinitele tepelne vodivosti pro materialy
double materialPorotherm            = 0.15;
double materialPolystyren           = 0.04;
double materialZelezobeton          = 1.43;
double materialZdivo                = 0.7;

// tepelne kapacity pro materialy
double kapacitaPorotherm            = 960;
double kapacitaPolystyren           = 1270;

// hustoty pro materialy
double hustotaPorotherm            = 800;
double hustotaPolystyren           = 30;

// hustota * kapacita
double roCePorotherm = kapacitaPorotherm * hustotaPorotherm;
double roCePolystyren = kapacitaPolystyren * hustotaPolystyren;

// sounicitel teplotni vodivosti a
// a = lambda / (ro * c)
double vodivostPorotherm = materialPorotherm / roCePorotherm;
double vodivostPolystyren = materialPolystyren / roCePolystyren;

// teplo Q=m*c*dt=ro*S*c*dt
// koeficienty m*c, resp. d*ro*c, plocha S se doda u zdi
double coefficientOutside = thicknessOutsidePorotherm * roCePorotherm + thicknessOutsidePolystyren * roCePolystyren;
double coefficientInside = thicknessInsidePorotherm * roCePorotherm;
double coefficientGround = thicknessInsidePorotherm * roCePorotherm + thicknessGroundPolystyren * roCePolystyren;
double coefficientRoof = thicknessRoofPorotherm * roCePorotherm + thicknessRoofPolystyren * roCePolystyren;

// relaxacni doba
// d1^2/2*a1 + d2^2/2*a2 + lambda1*d1*d2/a1*lambda2
double tauZeroOutside = thicknessOutsidePorotherm*thicknessOutsidePorotherm/2/vodivostPorotherm+thicknessOutsidePolystyren*thicknessOutsidePolystyren/2/vodivostPolystyren+materialPorotherm*thicknessOutsidePorotherm*thicknessOutsidePolystyren/vodivostPolystyren/materialPolystyren;
double tauZeroInside = thicknessInsidePorotherm*thicknessInsidePorotherm/2/vodivostPorotherm;
double tauZeroGround = thicknessGroundPorotherm*thicknessGroundPorotherm/2/vodivostPorotherm+thicknessGroundPolystyren*thicknessGroundPolystyren/2/vodivostPolystyren+materialPorotherm*thicknessGroundPorotherm*thicknessGroundPolystyren/vodivostPolystyren/materialPolystyren;
double tauZeroRoof = thicknessRoofPorotherm*thicknessRoofPorotherm/2/vodivostPorotherm+thicknessRoofPolystyren*thicknessRoofPolystyren/2/vodivostPolystyren+materialPorotherm*thicknessRoofPorotherm*thicknessRoofPolystyren/vodivostPolystyren/materialPolystyren;

// materialy pro jednotlive typy sten
double materialOutside = thicknessOutsidePorotherm/materialPorotherm + thicknessOutsidePolystyren/materialPolystyren;
double materialInside = thicknessInsidePorotherm/materialPorotherm;
double materialGround = thicknessGroundPorotherm/materialPorotherm + thicknessGroundPolystyren/materialPolystyren;
double materialRoof = thicknessRoofPorotherm/materialPorotherm + thicknessRoofPolystyren/materialPolystyren;
